<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
.dateWidth1{
   width:195px;
}
.select_width{
   width:130px;
}
</style>
<input type="hidden" name="organizations/organization[0]/sequence_no" value="1" >
<input type="hidden" name="organizations/organization[0]@submit_org" value="1" >
<input type="hidden" name="organizations/organization[0]/org_code" value="<x:out select="$xmlData/data/organizations/organization[@submit_org=1]/org_code"/>" >
<div class="t_bar">基本情况</div>
<table class="t_css" width="100%" border="0" cellpadding="0" id="basicInfo1" cellspacing="1" style="table-layout:fixed;">
	<col width="14%;"/>
	<col width="6%;"/>
	<col width="20%;"/>
	<col width="10%;"/>
	<col width="20%;"/>
	<col width="15%;"/>
	<col width="15%;"/>

	<tr >
		<td  align="right" colspan="2"><span class="color_red">*</span>项目名称（中文）：</td>
		<td colspan="5" >
			<input name="proposal/zh_title" id="zh_title" label="项目名称（中文）" type="text"  class="input_text required " style="width:592px;"  maxlength="30" value="<x:out select="$xmlData/data/proposal/zh_title" />"/>（限30个字）
		</td>
	</tr>
	<tr >
		<td  align="right" colspan="2"><span class="color_red">*</span>项目名称（英文）：</td>
		<td colspan="5" >
			<input name="proposal/en_title" id="en_title" label="项目名称（英文）" type="text"  class="input_text required " style="width:592px;"  maxlength="200" value="<x:out select="$xmlData/data/proposal/en_title" />"/>（限200个字）
		</td>
	</tr>
	<tr >
		<td  align="right" colspan="2" ><span class="color_red">*</span>主题词：</td>
		<td colspan="5">
			<input name="proposal/subject_term" id="subject_term" type="text" label="主题词" class="input_text required " maxlength="100" style="width:592px;" value="<x:out select="$xmlData/data/proposal/subject_term" />"/>
			<br/>（注：按《国家汉语主题词表》填写3个至7个与推荐项目技术内容密切相关的主题词，每个词语间应加“；”号）
		</td>
	</tr>
</table>
<table class="t_css" width="100%" border="0" cellpadding="0" id="basicInfo2" cellspacing="1" style="table-layout:fixed;">
	<col width="14%;"/>
	<col width="6%;"/>
	<col width="20%;"/>
	<col width="10%;"/>
	<col width="20%;"/>
	<col width="15%;"/>
	<col width="15%;"/>
	<tr style="background-color:#fbfbfb;">
		<td align="right" colspan="2" ><span class="color_red">*</span>学科分类1：</td>
  		 <td>
          <c:set var="subject">{'id':'<x:out select="$xmlData/data/proposal/subject_code" />',
						       'name':'<x:out select="$xmlData/data/proposal/subject_name" />'}
		  </c:set>
			<cpt:tree key="technological" className="hn_iuput_kuang required" 
			onlyChooseLeaf="true" readonly="true" 
			cacheable="false"  value="${subject}" id="subject" name="proposal/subject"  
			showPattern="all" shieldPattern="-1 " onClick="initTreeValuejsdtr"   label="学科分类1" />
			<input type="hidden" id="subject_code" name="proposal/subject_code" value="<x:out select="$xmlData/data/proposal/subject_code" />" /> 
			<input type="hidden" id="subject_name" name="proposal/subject_name" value="<x:out select="$xmlData/data/proposal/subject_name" />" />
			</td>
  	 	  <td align="right">代码：</td>
  	 	<td>
  	 	<input id="subject_value" label="学科分类1-->代码"
				type="text" class="gray" disabled="disabled" style="width:110px;"
				maxlength="50" name="proposal/subject_value"
				value="<x:out select="$xmlData/data/proposal/subject_value" />" />
  	 	</td>
  	 	 <td align="right" >专业评审组名称：</td>
  	 	<td>
  	 	<input id="department_value" type="hidden" name="proposal/department_value"  
  	 	label="专业评审组名称"  value="<x:out select="$xmlData/data/proposal/department_value" />"/>
            <span id="department_name"  name="proposal/department_name"><x:out select="$xmlData/data/proposal/department_name" /></span>
                
		</td>
	</tr>
	
		<tr style="background-color:#f1f1f1;">
		<td align="right" colspan="2">学科分类2：</td>
  		 <td>
          <c:set var="subject4">{'id':'<x:out
						select="$xmlData/data/proposal/subject4_code" />','name':'<x:out
						select="$xmlData/data/proposal/subject4_name" />'}
		  </c:set>
			<cpt:tree key="technological" className="hn_iuput_kuang" cacheable="false" readonly="true" value="${subject4}" id="subject4" name="proposal/subject4"  showPattern="all" shieldPattern="-1 " onClick="initTreeValuejsdtr"   label="学科分类2" />
			<input type="hidden" id="subject4_code" name="proposal/subject4_code" value="<x:out select="$xmlData/data/proposal/subject4_code" />"  /> 
			<input type="hidden" id="subject4_name" name="proposal/subject4_name" value="<x:out select="$xmlData/data/proposal/subject4_name" />" />
			</td>
  	 	  <td align="right" >代码：</td>
  	 	<td colspan="3">
  	 	<input id="subject4_value" label="学科分类2-->代码"
				type="text" class="gray" disabled="disabled" style="width:110px;"
				maxlength="50" name="proposal/subject4_value"
				value="<x:out select="$xmlData/data/proposal/subject4_value" />" />
  	 	</td>
	</tr>
	<tr style="background-color:#fbfbfb;">
		<td align="right" colspan="2">学科分类3：</td>
  		 <td>
          <c:set var="subject5">{'id':'<x:out
						select="$xmlData/data/proposal/subject5_code" />','name':'<x:out
						select="$xmlData/data/proposal/subject5_name" />'}
		  </c:set>
			<cpt:tree key="technological" className="hn_iuput_kuang"  cacheable="false" readonly="true" value="${subject5}" id="subject5" name="proposal/subject5"  showPattern="all" shieldPattern="-1 " onClick="initTreeValuejsdtr"   label="学科名称3" />
			<input type="hidden" id="subject5_code" name="proposal/subject5_code" value="<x:out select="$xmlData/data/proposal/subject5_code" />"/> 
			<input type="hidden" id="subject5_name" name="proposal/subject5_name" value="<x:out select="$xmlData/data/proposal/subject5_name" />" />
			</td>
  	 	  <td align="right">代码：</td>
  	 	<td colspan="3">
  	 	<input id="subject5_value" label="学科分类3-->代码"
				type="text" class="gray" disabled="disabled" style="width:110px;"
				maxlength="50" name="proposal/subject5_value"
				value="<x:out select="$xmlData/data/proposal/subject5_value" />" />
  	 	</td>
	</tr>
</table>
<table class="t_css" width="100%" border="0" cellpadding="0" id="basicInfo3" cellspacing="1" style="table-layout:fixed;">
	<col width="14%;"/>
	<col width="6%;"/>
	<col width="20%;"/>
	<col width="10%;"/>
	<col width="20%;"/>
	<col width="15%;"/>
	<col width="15%;"/>
	<tr >
		<td  align="right" colspan="2"><span class="color_red">*</span>科技成果名称：</td>
		<td  colspan="5">
			<input name="proposal/achievement_name" id="achievement_name" label="科技成果名称" type="text"  class="input_text required" style="width:592px;" maxlength="100"  value="<x:out select="$xmlData/data/proposal/achievement_name" />"/>
		</td>
		
	</tr>
	<tr>
		<td  align="right" colspan="2"><span class="color_red">*</span>省级成果登记号：</td>
		<td  colspan="2">
			<input name="proposal/reg_no" id="reg_no" label="省级成果登记号" type="text"  class="input_text required" style="width:121px;"   maxlength="100" value="<x:out select="$xmlData/data/proposal/reg_no" />"/>
		</td>
		
		<td  align="right"><span class="color_red">*</span>奖励类别 ：</td>
		<td  colspan="2">
			<c:set var="award_category_value"><x:out select="$xmlData/data/proposal/award_category_value" /></c:set>
			<cpt:select id="award_category"  key="award_category"  value="${award_category_value}" onChange="initControlValue(this.id);" style="width:150px;"></cpt:select>
			<input type="hidden" id="award_category_value" name="proposal/award_category_value" class="required" value="${award_category_value}" label="奖励类别">
			<input type="hidden" name="proposal/award_category_name" value="<x:out select="$xmlData/data/proposal/award_category_name" />">
		</td>
	</tr>
 	<tr >
		<td  align="right" colspan="2"><span class="color_red">*</span>计划名称：</td>
		<td colspan="2">
			<input name="proposal/project_name" id="project_name_num" maxlength="100" type="text" label="计划名称" class="input_text required " style="width:121px;" value="<x:out select="$xmlData/data/proposal/project_name" />"/>
		</td>
		<td  align="right"><span class="color_red">*</span>计划编号：</td>
		<td  colspan="2">
			<input name="proposal/project_num" id="project_num" label="计划编号" type="text" maxlength="100" class="input_text required" style="width:121px;" value="<x:out select="$xmlData/data/proposal/project_num" />"/>
		</td>
	</tr>
	<tr>
  	   <td align="right" colspan="2"><span class="color_red">*</span>所属国民经济行业：</td>
       <td colspan="5">
       		<c:set var="belong_industry">{'id':'<x:out select="$xmlData/data/proposal/belong_industry_code" />',
       		'name':'<x:out select="$xmlData/data/proposal/belong_industry_name" />'}</c:set>
       	  <cpt:tree key="belong_industry" cacheable="false" readonly="true" value="${belong_industry}" label="所属国民经济行业"
       		id="belong_industry" name="belong_industry" showPattern="all" shieldPattern="0" onClick="initTreeValueExt2"></cpt:tree>
	        <input type="hidden" name="proposal/belong_industry_code" value="<x:out select="$xmlData/data/proposal/belong_industry_code" />" class="required"  label="所属国民经济行业"/>
	        <input type="hidden" name="proposal/belong_industry_name" value="<x:out select="$xmlData/data/proposal/belong_industry_name" />"/>
      </td>
<%-- 	  <td  align="right"><span class="color_red">*</span>任务来源：</td>
		<td colspan="2">
			<c:set var="mission_source">{'id':'<x:out select="$xmlData/data/proposal/mission_source_value" />',
			'name':'<x:out select="$xmlData/data/proposal/mission_source_name" />'}
		  	</c:set>
			<cpt:tree key="mission_source" cacheable="false" readonly="true" value="${mission_source}" id="mission_source" name="proposal/mission_source"  showPattern="all" shieldPattern="0" onClick="initTreeValueExt" label="任务来源" />
			<input type="hidden" name="proposal/mission_source_value" class="required" label="任务来源" value="<x:out select="$xmlData/data/proposal/mission_source_value" />" >
			<input type="hidden" name="proposal/mission_source_name" value="<x:out select="$xmlData/data/proposal/mission_source_name" />">
		</td> --%>
	</tr>
	<tr>
		<td align="right" colspan="2"><span class="color_red">*</span>任务来源：</td>
	
		<td colspan="5">
			国家级科技计划：<br>
			<cpt:checkbox key="mission_source2" name="mission_source2" repeatColumn="4" tagType="checkbox" style="border: 0px; padding: 0px; margin: 0px;" lastOther="true" ></cpt:checkbox>
         	<input type="hidden" name="proposal/mission_source2_value" id="missionsource2" value="<x:out select="$xmlData/data/proposal/mission_source2_value" />" label="国家级科技计划"/>
         	<input type="hidden" name="proposal/mission_source2_name" value="<x:out select="$xmlData/data/proposal/mission_source2_name" />" />
         	省、部级计划：<br>
         	<cpt:checkbox key="mission_source3" name="mission_source3" repeatColumn="4" tagType="checkbox" style="border: 0px; padding: 0px; margin: 0px;" lastOther="true" ></cpt:checkbox>
         	<input type="hidden" name="proposal/mission_source3_value" id="missionsource3" value="<x:out select="$xmlData/data/proposal/mission_source3_value" />" label="省、部级计划"/>
        	<input type="hidden" name="proposal/mission_source3_name" value="<x:out select="$xmlData/data/proposal/mission_source3_name" />" />
         	其他：<br>
         	<cpt:checkbox key="mission_source4" name="mission_source4" repeatColumn="4" tagType="checkbox" style="border: 0px; padding: 0px; margin: 0px;" lastOther="true" ></cpt:checkbox>
         <input type="hidden" name="proposal/mission_source4_value" id="missionsource4" value="<x:out select="$xmlData/data/proposal/mission_source4_value" />" label="其他"/>
         <input type="hidden" name="proposal/mission_source4_name" value="<x:out select="$xmlData/data/proposal/mission_source4_name" />" /> 
		</td>
	</tr>
	<tr >
		<td  align="right" colspan="2"><span class="color_red">*</span>项目名称可否公布：</td>
		<td colspan="2">
			  <cpt:checkbox key="item_choose" className="required" name="proposal/show_title" repeatColumn="2" tagType="radio" style="border: 0px; padding: 0px; margin: 0px;" onClick="setRendingType('show_title_value');"></cpt:checkbox>
         	<input type="hidden" name="proposal/show_title_value" id="show_title_value" value="<x:out select="$xmlData/data/proposal/show_title_value" />" class="required" label="项目名称可否公布"/>
         	<input type="hidden" name="proposal/show_title_name" value="<x:out select="$xmlData/data/proposal/show_title_name" />"/> 
		</td>
		<td  align="right" style="border-bottom:0px;"><span class="color_red">*</span>推荐单位（或专家）：</td>
		<td  style="border-bottom:0px;" colspan="2">
			<c:set var="recommend_type_value"><x:out select="$xmlData/data/proposal/recommend_type_value" /></c:set>
			<cpt:select id="recommend_type"  key="recommend_type"  value="${recommend_type_value}" onChange="initControlValue(this.id);setRecommend();"  style="width:150px;"></cpt:select>
			<input type="hidden" id="recommend_type_value" name="proposal/recommend_type_value" class="required" value="${recommend_type_value}" label="推荐单位（或专家）">
			<input type="hidden" name="proposal/recommend_type_name" value="<x:out select="$xmlData/data/proposal/recommend_type_name" />">
		</td>
	</tr>
     <tr id="tr_show_title">
		<td align="right"  colspan="2"><span class="color_red">*</span>密级：</td>
		<td colspan="2">
			<c:set var="thick_level_value"><x:out select="$xmlData/data/proposal/thick_level_value" /></c:set>
			<cpt:select id="thick_level"  key="security_deadline"  value="${thick_level_value}" onChange="initControlValue(this.id);sendtitle();"  style="width:150px;"></cpt:select>
			<input type="hidden" id="thick_level_value" name="proposal/thick_level_value"  value="${thick_level_value}" label="密级">
			<input type="hidden" id="thick_level_name" name="proposal/thick_level_name" value="<x:out select="$xmlData/data/proposal/thick_level_name" />">
			<%-- <input id="show_title_level" type="text" name="proposal/thick_level" maxlength="100" label="密级"  value="<x:out select="$xmlData/data/proposal/thick_level" />"/>  --%>
		</td>
		<td  align="right" ><span class="color_red">*</span>保密期限：</td>
		<td colspan="2">
			<input id="show_title_scope" type="text" name="proposal/security_deadline" maxlength="100" label="保密期限"  value="<x:out select="$xmlData/data/proposal/security_deadline" />"/> 
			 <%-- <c:set var="security_deadline_date"><x:out select="$xmlData/data/proposal/security_deadline_date" /></c:set>
			<cpt:date id="show_title_scope" name="proposal/security_deadline_date" value="${security_deadline_date}" label="保密期限" ></cpt:date>  --%>
		</td>
		
	</tr>
	<tr id="gongbu1">
		<td  align="right" colspan="2"><span class="color_red">*</span>项目起始时间：</td>
	   <td colspan="2">
		 	<c:set var="start_date"><x:out select="$xmlData/data/proposal/start_date" /></c:set>
			<cpt:date id="start_date" name="proposal/start_date" value="${start_date}" className=" required date   dateCompare:end_date " label="项目起始时间" ></cpt:date> 
	   </td>
	   <td  align="right" ><span class="color_red">*</span>项目完成时间：</td>
	   <td colspan="2">
	    	<c:set var="end_date"><x:out select="$xmlData/data/proposal/end_date" /></c:set>
			<cpt:date id="end_date" name="proposal/end_date" value="${end_date}" className=" required date" label="项目完成时间" ></cpt:date> 
	   </td>
	</tr>
	<tr id="gongbu2">
		<td align="right" colspan="2"><span class="color_red">*</span>推荐单位：</td>
		<td colspan="5">
		<c:set var="recomend_org">
		{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />',
		'name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'
		}					
		</c:set> <cpt:tree id="recomend_org" key="recommended"
				cacheable="false" className="hn_iuput_kuang required selectWidth3"
				readonly="true" value="${recomend_org}" label="推荐单位"
				showPattern="all" shieldPattern="0"
				onClick="initTreeValue2_qhh">
			</cpt:tree> <input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value"
			value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" />
			<input type="hidden" id="recomend_org_name" name="proposal/recomend_org_name"
			value="<x:out select="$xmlData/data/proposal/recomend_org_name" />" />
		</td>
	</tr>
	<%-- <tr>
		<td colspan="5">
		<cpt:checkbox key="mission_source2" name="mission_source2" repeatColumn="3" tagType="checkbox" style="border: 0px; padding: 0px; margin: 0px;" lastOther="true" ></cpt:checkbox>
         <input type="hidden" name="proposal/mission_source2_value" id="missionsource2" value="<x:out select="$xmlData/data/proposal/mission_source2_value" />" class="required" label="国家级科技计划"/>
         <input type="hidden" name="proposal/mission_source2_name" value="<x:out select="$xmlData/data/proposal/mission_source_name" />" /> 
		</td>
	</tr>
	<tr>
		<td colspan="5">省、部级计划：</td>
	</tr>
	<tr>
		<td colspan="5">
		<cpt:checkbox key="mission_source3" name="mission_source3" repeatColumn="3" tagType="checkbox" style="border: 0px; padding: 0px; margin: 0px;" lastOther="true" ></cpt:checkbox>
         <input type="hidden" name="proposal/mission_source3_value" id="missionsource3" value="<x:out select="$xmlData/data/proposal/mission_source3_value" />" class="required" label="省、部级计划"/>
         <input type="hidden" name="proposal/mission_source3_name" value="<x:out select="$xmlData/data/proposal/mission_source_name" />" /> 
		</td>
	</tr>
	<tr>
		<td colspan="5">其他：</td>
	</tr>
	<tr>
		<td colspan="5">
		<cpt:checkbox key="mission_source4" name="mission_source4" repeatColumn="3" tagType="checkbox" style="border: 0px; padding: 0px; margin: 0px;" lastOther="true" ></cpt:checkbox>
         <input type="hidden" name="proposal/mission_source4_value" id="missionsource4" value="<x:out select="$xmlData/data/proposal/mission_source4_value" />" class="required" label="其他"/>
         <input type="hidden" name="proposal/mission_source4_name" value="<x:out select="$xmlData/data/proposal/mission_source_name" />" /> 
		</td>
	</tr> --%>
	</table>

<script type="text/javascript">





$(function(){
 	setRecommend();	 
	setRendingType('show_title_value');
	/* setSummary(); */
});

function setRecommend(){
	var recommend_type = $("#recommend_type_value").val();
	if(recommend_type == '02'){   //专家推荐
		$("#tab10").show();
		$("#gongbu2").hide();
		$("#recomend_org_value").val("");
		$("#recomend_org_name").val("");
		$("#recomend_org").val("");
		$("#recomend_org").removeClass("required");
	}else if(recommend_type == '01'){     //单位推荐
	
		$("#tab10").hide();
		$("#gongbu2").show();
		$("#recomend_org").addClass("required");
		$("#recPro_upload").find("input[id='file_code']").val("");
		$("#recPro_upload").find("span[id='file_name']").text("");
		$("#recPro_upload").find("span[id='file_date']").text("");
		$("#recPro_upload").find("tr[id='uploadsuccess']").hide();
		$("#recPro_upload .file").val("");
	}else{
		$("#tab10").hide();
		$("#gongbu2").hide();
		$("#recomend_org_value").val("");
		$("#recomend_org_name").val("");
		$("#recomend_org").val("");
		$("#recomend_org").removeClass("required");
		$("#recPro_upload").find("input[id='file_code']").val("");
		$("#recPro_upload").find("span[id='file_name']").text("");
		$("#recPro_upload").find("span[id='file_date']").text("");
		$("#recPro_upload").find("tr[id='uploadsuccess']").hide();
		$("#recPro_upload .file").val("");
	}
}

function setRendingType(obj){
	var value =$("#"+obj).val();
	if(value == '1'){
			$("#tr_show_title").show();
			//$("#show_title_scope").parents("td").find("[class='datepick-trigger']").attr('style','padding-left: 3px; cursor: pointer; vertical-align: middle;');
			$("#show_title_scope").removeAttr('disabled');
			$("#thick_level_value").attr("class","required");
			$("#show_title_scope").attr("class","required");
			$("#gongbu1").attr("class","li_1");
			$("#gongbu2").attr("class","li_2");
			//$("#show_title_scope").parents("td").find("[class='datepick-trigger']").removeAttr('disabled');
	}else{
		   $("#tr_show_title").hide();
		   $("#gongbu1").attr("class","li_2");
			$("#gongbu2").attr("class","li_1");
			$("#thick_level").val("");
			$("#thick_level_value").val("");
			$("#thick_level_name").val("");
			$("#show_title_scope").val("");
			$("#thick_level_value").attr("class","");
			$("#show_title_scope").attr("class","");
	}
}


	function setParent(id,showFlag){
		var parentTr = $("#" + id).parent();
		  if(parentTr.is('tr')){
			  if(showFlag)
			  	parentTr.show();
			  else
			  	parentTr.hide();
		  }else{
			  if(showFlag)
			  	  parentTr.parent().show();
			  else
				  parentTr.parent().hide();
		  }
	}



function initTreeValue2_qhh(treeId, treeNode) {
  	//针对单位性质
   	if (( treeNode && treeNode.isParent)) {
		scmWarn("请选择具体的"+$("#" + treeId).attr("label"));
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
			return false;
	} 
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			//str = obj.name + "-" + str;
			obj = obj.parentNode;
		}
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
		$("#" + treeId).val(str);
		
	
		setInformation(treeNode.id);
	}





	function setInformation(re_org_code){
		
		if(re_org_code !=null){
		 $.ajax({
	         type: "post",
	         url: "${ctx}/proposal/get-reorg-contactinfo",
	         data: {re_org_code:re_org_code},
	         dataType: "json",
	         success: function(data){
	        	            /*   alert(JSON.stringify(data) );
	        	            alert(data.PNAME); */
	        	       if(data.PNAME == null || data.TEL == null || data.EMAIL == null || data.FAX == null){
	        	    	   irisValaddMsg("请联系相应的推荐单位完善单位信息");
	        	       }else{
	        	    	   $("#reco_lixiren").val(data.PNAME);
	                   $("#reco_mobile").val(data.TEL);
	                   $("#reco_email").val(data.EMAIL);
	                   $("#reco_fax").val(data.FAX);
	                   }
	                  }
	     });
		}
	}











//显示全名称路径
function buildName(treeNode, params){
	var str = treeNode.name;
	var obj = treeNode.parentNode;
	while(obj!=null){
		//str =obj.name+"-"+str;
		obj = obj.parentNode;
	}
	return str;
}

function initTreeValueExt(treeId, treeNode) {

	if (( treeNode && treeNode.level == 0)) {
		scmWarn($("#" + treeId).attr("label")+"不能选择第一级，请选择它的子级！");
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
			return false;
	}
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			//str = obj.name + "-" + str;
			obj = obj.parentNode;
		}
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
		$("#" + treeId).val(str);

}

function initTreeValueExt2(treeId, treeNode) {

	/*if (( treeNode && treeNode.level == 0)) {
		scmWarn($("#" + treeId).attr("label")+"不能选择第一级，请选择它的子级！");
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
			return false;
	}*/
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			//str = obj.name + "-" + str;
			obj = obj.parentNode;
		}
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
		$("#" + treeId).val(str);

}




function initTreeValue2(treeId, treeNode) {
  	//针对单位性质
  	if (( treeNode && treeNode.level == 0)) {
		scmWarn("请选择具体的"+$("#" + treeId).attr("label"));
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
			return false;
	}
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			//str = obj.name + "-" + str;
			obj = obj.parentNode;
		}
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
		$("#" + treeId).val(str);
		initTreeValue2CallBack();
	}
	
	function setRequired(){
		var isSecret = $("#issecret").val();
		if(isSecret == '01'){
			$("#approve_no").addClass("required");
			$("#approve_no").parent().prev().html("<span class='color_red'>*</span>密级、保密期限及批准号：");
		}
		else{
			$("#approve_no").removeClass("required");
			$("#approve_no").parent().prev().html("密级、保密期限及批准号：");
		}
	}
	
	function initTreeValuejsdtr(treeId, treeNode) {
		if (( treeNode && treeNode.level == 0)) {
			scmWarn($("#" + treeId).attr("label")
					+ messageTip.researchAreaInvalidDisciplineCode);
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name']").val("");
			return false;
		}else if(treeNode.level == 1 && treeNode.isParent){
			scmWarn("请选择下面的子节点");
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name']").val("");
			return false;
		}else{
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code']").val(treeNode.id);
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name']").val(treeNode.name);
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value']").val(treeNode.id);
		}
  	
		
	var oldval = $("#" + treeId).parents("td").find("[name$='" + treeId + "_code']").val();
	var oldname = $("#" + treeId).parents("td").find("[name$='" + treeId + "_name']").val();
	oldval = $.trim(oldval);
	oldname = $.trim(oldname);
	var str = treeNode.name;
	var obj = treeNode.parentNode;
	while (obj != null) {
		str = obj.name + "-" + str;
		obj = obj.parentNode;
	}
	/* $("#" + treeId).parents("td").find("[name$='" + treeId + "_all_name']").val(str); */
	if(treeId=="subject"){
		if(treeNode.level > 1){
			$("#department_name").text(treeNode.parentNode.parentNode.name);
			$("#department_value").val(treeNode.parentNode.parentNode.id);
		}else{
			$("#department_name").text(str);
			$("#department_value").val(treeNode.id);
		}
		
	}
	
	$("#" + treeId + "_value").val(treeNode.id);

}
	function setEmptyValueForTree(id){
		$("#"+id).val("");
		$("#"+id+"_code").val("");
		$("#"+id+"_value").val("");
		$("#"+id+"_name").val("");
		$("#" + id).parents("td").find("[name$='" + id + "_code'],[id$='" + id + "_code']").val("");
		$("#" + id).parents("td").find("[name$='" + id + "_value'],[id$='" + id + "_value']").val("");
		$("#" + id).parents("td").find("[name$='" + id + "_name'],[id$='" + id + "_name']").val("");
		if(id=="subject"){
			$("#department_name").text("");
			$("#department_value").val("");
		}
		
	}
	function sendtitle(){
		var thick_level_value=$("#thick_level_value").val();
		if(thick_level_value > 0 && thick_level_value < 4){
			alert("项目涉密，建议不申报，请咨询省科技厅。");
		}
		
	}
	function missionsource()
	{
		var missionsource2=$("#missionsource2").val();
		var missionsource3=$("#missionsource3").val();
		var missionsource4=$("#missionsource4").val();
		if(missionsource2=="" && missionsource3=="" && missionsource4==""){
			return true;
		}
		return false;
	}
</script>


